package com.hightemperator.controller;


import com.hightemperator.po.MessageAndDetail;
import com.hightemperator.service.MessageService;
import com.hightemperator.util.LocalResponseBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/message")
public class MessageController {
    @Resource
    private MessageService messageService;


    /**
     * 查询活动信息
     * @param reciverId
     * @return
     */
    @RequestMapping("getMessage")
    public LocalResponseBody getMessageByReciverId(@RequestParam(value = "reciverId") Integer reciverId){
        List<MessageAndDetail> list  = messageService.getMessageByReciverId(reciverId);
        return new LocalResponseBody("操作成功").doSuccess(list);
    }
}